﻿//-----------------------------------------------------------------------
// <copyright file="Firma.cs" company="CronopioDD">
//     Copyright CronopioDD. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------
namespace ProyectoGoya.Models
{
    using System;
    using System.ComponentModel.DataAnnotations;
    using System.Web.Mvc;
    using ProyectoGoya.Controllers;

    /// <summary>
    /// Firma Business Object
    /// </summary>
    public class Firma
    {
        #region Properties

        /// <summary>
        /// Gets or sets FirmaId
        /// </summary>
        [ScaffoldColumn(false)]
        public int FirmaId { get; set; }

        /// <summary>
        /// Gets or sets Nombre
        /// </summary>
        [Required(ErrorMessage = "El campo {0} es obligatorio")]
        [DataType(DataType.Text)]
        public string Nombre { get; set; }

        /// <summary>
        /// Gets or sets Apellido
        /// </summary>
        [Required(ErrorMessage = "El campo {0} es obligatorio")]
        [DataType(DataType.Text)]
        public string Apellido { get; set; }

        /// <summary>
        /// Gets or sets Dni
        /// </summary>
        [Required(ErrorMessage = "El campo {0} es obligatorio")]
        [DniValidation(ErrorMessage="DNI ya ingresado")]
        [Remote("CheckExistence", "Security", ErrorMessage = "DNI ya ingresado",HttpMethod="GET")]
        [RegularExpression(@"^\d+$", ErrorMessage = "Ingrese sólo dígitos")]
        [DataType(DataType.Text)]
        [Display(Name = "DNI")]
        public string Dni { get; set; }

        /// <summary>
        /// Gets or sets Email
        /// </summary>
        [DataType(DataType.EmailAddress)]
        [RegularExpression(@"[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}", ErrorMessage = "Email no válido")]
        [Display(Name = "Email (Opcional)")]
        public string Email { get; set; }

        /// <summary>
        /// Gets or sets Fecha
        /// </summary>
        [ScaffoldColumn(false)]
        [DataType(DataType.DateTime)]
        public DateTime Fecha { get; set; }

        #endregion

    }
}